home *** CD-ROM | disk | FTP | other *** search
- property pCurrentFilterBtn
- global FORWARD, BACKWARD, SPRITE_GRID, SPRITE_BOX, SPRITE_SMALLFOTO, SPRITE_DESCRIPTION, SPRITE_FILTER_FIRST, SPRITE_FILTER_LAST, SPRITE_PGBWD_BTN, SPRITE_PGFWD_BTN, SPRITE_RECIPE_FIRST, SPRITE_RECIPE_LAST, SPRITE_HDR, CAST_DUMMY_RECPIC, CAST_SMFOTOS_BASE, CAST_DESCRIPTION_BASE, gSpriteNumber, gReturnPressed, gpage, gGridObj
-
- on new me
- set pCurrentFilterBtn to SPRITE_FILTER_FIRST
- downbutton(pCurrentFilterBtn)
- set h to the left of sprite SPRITE_GRID - 195
- set v to the top of sprite SPRITE_GRID - 150
- set rows to 12
- set cols to 1
- set gGridObj to new(script "NEW GRID", SPRITE_GRID, SPRITE_BOX, [h, v], [rows, cols], [377, 24], [2, 2])
- SetFilter(1)
- return me
- end
-
- on setlastpage
- set gpage to getpage(gGridObj)
- end
-
- on returntoindex me
- spriteVisible(41, 52, 0)
- set the visible of sprite 14 to 0
- SetFilter(pCurrentFilterBtn - SPRITE_FILTER_FIRST + 1)
- downbutton(pCurrentFilterBtn)
- setPage(gGridObj, gpage)
- ViewRecipePics(1)
- updateStage()
- spriteVisible(41, 52, 1)
- set the visible of sprite 14 to 1
- end
-
- on HandleFilterBtn me, UpOrDown
- case UpOrDown of
- #mouseDown:
- if (gSpriteNumber = pCurrentFilterBtn) and (gSpriteNumber <> SPRITE_FILTER_LAST) then
- exit
- end if
- upbutton(pCurrentFilterBtn)
- downbutton()
- puppetSound("camera.aif")
- #mouseUp:
- if (gSpriteNumber = pCurrentFilterBtn) and (gSpriteNumber <> SPRITE_FILTER_LAST) then
- exit
- end if
- if (the clickOn <> gSpriteNumber) and not gReturnPressed then
- exit
- end if
- set pCurrentFilterBtn to gSpriteNumber
- SetFilter(pCurrentFilterBtn - SPRITE_FILTER_FIRST + 1)
- end case
- return
- end
-
- on SetFilter index
- global gRecipeObj
- setCatNdx(gRecipeObj, index)
- if getNumOfRecipes(gRecipeObj) = 0 then
- set gSpriteNumber to SPRITE_FILTER_FIRST
- alert("No matches found")
- upbutton(pCurrentFilterBtn)
- downbutton()
- set pCurrentFilterBtn to gSpriteNumber
- SetFilter(1)
- exit
- end if
- ResetGrid(gGridObj, getNumOfRecipes(gRecipeObj), index)
- ViewRecipePics(1)
- end
-
- on GoNEXTInSequence me, direction
- GoNextPage(gGridObj, direction)
- ViewRecipePics(1)
- end
-
- on handleRollover me
- global glastsprite
- if the rollOver = glastsprite then
- exit
- end if
- set pageNumber to getpagenumber(gGridObj)
- set currentSprite to the rollOver
- set cell to currentSprite - 40
- set x to ((pageNumber - 1) * 12) + cell
- set RecipesL to GetRecipeList(gRecipeObj)
- if (currentSprite >= SPRITE_RECIPE_FIRST) and (currentSprite <= SPRITE_RECIPE_LAST) and (x <= count(RecipesL)) then
- set the rect of sprite SPRITE_BOX to the rect of sprite currentSprite
- ViewRecipePics(cell)
- updateStage()
- end if
- set glastsprite to currentSprite
- end
-
- on ResetFilterBtns me
- global gSpriteNumber
- if gSpriteNumber <> pCurrentFilterBtn then
- downbutton(pCurrentFilterBtn)
- upbutton(gSpriteNumber)
- end if
- end
-
- on ViewRecipePics cell
- global gRecipeObj, SPRITE_SUPERPIC, glastsprite
- set pageNumber to getpagenumber(gGridObj)
- set x to ((pageNumber - 1) * 12) + cell
- setCatRecNdx(gRecipeObj, x)
- set category to getCatNdx(gRecipeObj)
- set iRecipe to getRecipeNumber(gRecipeObj, category, x)
- set the memberNum of sprite SPRITE_SUPERPIC to GetSuperPIC(gRecipeObj, iRecipe)
- set the memberNum of sprite SPRITE_DESCRIPTION to iRecipe
- set glastsprite to 0
- end
-